const express = require('express');
const router = express.Router();

const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `${i}`,
        code: `dealerCode${i}`,
        name: `dealerName${i}`,
        branchCode: `branchCode${i}`,
        provinceName: `provinceName${i}`,
        cityName: `cityName${i}`,
        countyName: `countyName${i}`,
        contactName: `contactName${i}`,
        contactPhone: `contactPhone${i}`,
        address: `address${i}`,
        currency: 1,
        countryName: `countryName${i}`,
        tradeMethodId: `tradeMethodId${i}`,
        tradeMethodName: `tradeMethodName${i}`,
        marketDepartmentName: `marketDepartmentName${i}`,
        contactNumber: '1534163',
        zipCode: '404000',
    });

router.get('/forServiceInformation/simple', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data.slice(0, 10),
        }
    });
});

router.get('/forServiceInformation', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data,
            totalElements: data.length,
        }
    });
});
router.get('/forCBUSaleOrder/simple', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data.slice(0, 10),
        }
    });
});

router.get('/forCBUSaleOrder', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data,
            totalElements: data.length,
        }
    });
});
router.get('/forSubDealer/simple', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data.slice(0, 10),
        }
    });
});

router.get('/forSubDealer', (req, res) => {
    const dealers = [];
    for(let i = 0; i < 40; i++)
        dealers.push({
            id: `${i}`,
            code: `subDealer${i}`,
            name: `name${i}`,
            shortCode: `shortCode${i}`,
            shortName: `shortName${i}`,
            countryName: '中国',
            provinceName: `湖北省${i}`,
            cityName: `cityName${i}`,
            address: `address${i}`,
            marketDepartmentName: `marketDepartmentName${i}`,
        });
    res.json({
        message: 'ok',
        payload: {
            content: dealers,
            totalElements: dealers.length,
        }
    });
});
router.get('/forClaim/simple', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data.slice(0, 10),
        }
    });
});

router.get('/forClaim', (req, res) => {
    const dealers = [];
    for(let i = 0; i < 40; i++)
        dealers.push({
            id: `${i}`,
            code: `subDealer${i}`,
            name: `name${i}`,
            shortCode: `shortCode${i}`,
            shortName: `shortName${i}`,
            countryName: '中国',
            provinceName: `湖北省${i}`,
            cityName: `cityName${i}`,
            address: `address${i}`,
            currency: 1
        });
    res.json({
        message: 'ok',
        payload: {
            content: dealers,
            totalElements: dealers.length,
        }
    });
});

router.get('/forDocumentSubmitRule/simple', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            content: data.slice(0, 10),
        }
    });
});

router.get('/forDocumentSubmitRule', (req, res) => {
    const dealers = [];
    for(let i = 0; i < 40; i++)
        dealers.push({
            id: `${i}`,
            code: `subDealer${i}`,
            name: `name${i}`,
            shortCode: `shortCode${i}`,
            shortName: `shortName${i}`,
            countryName: '中国',
            provinceName: `湖北省${i}`,
            cityName: `cityName${i}`,
            address: `address${i}`,
            currency: 1,
        });
    res.json({
        message: 'ok',
        payload: {
            content: dealers,
            totalElements: dealers.length,
        }
    });
});

module.exports = router;
